package com.htc.android.footprints.utils;

import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.media.MediaPlayer;
import android.util.Log;

public class SoundPlayer
{
  private static final String TAG = "SoundUtils";
  private Context mContext;
  private MediaPlayer mPlayer;

  public SoundPlayer(Context paramContext)
  {
    this.mContext = paramContext;
    this.mPlayer = new MediaPlayer();
  }

  public void play()
  {
    this.mPlayer.seekTo(0);
    this.mPlayer.start();
  }

  public void prepareCarmerFocused()
  {
    try
    {
      AssetFileDescriptor localAssetFileDescriptor = this.mContext.getResources().openRawResourceFd(2131099649);
      if (this.mPlayer != null)
      {
        this.mPlayer.reset();
        this.mPlayer.setDataSource(localAssetFileDescriptor.getFileDescriptor(), localAssetFileDescriptor.getStartOffset(), localAssetFileDescriptor.getLength());
        this.mPlayer.setAudioStreamType(1);
        this.mPlayer.prepare();
      }
      return;
    }
    catch (Exception localException)
    {
      while (true)
        Log.d("SoundUtils", "Couldn't create focus sound", localException);
    }
  }

  public void prepareCarmerFocusing()
  {
    try
    {
      AssetFileDescriptor localAssetFileDescriptor = this.mContext.getResources().openRawResourceFd(2131099650);
      if (this.mPlayer != null)
      {
        this.mPlayer.reset();
        this.mPlayer.setDataSource(localAssetFileDescriptor.getFileDescriptor(), localAssetFileDescriptor.getStartOffset(), localAssetFileDescriptor.getLength());
        this.mPlayer.setAudioStreamType(1);
        this.mPlayer.prepare();
      }
      return;
    }
    catch (Exception localException)
    {
      while (true)
        Log.d("SoundUtils", "Couldn't create focus sound", localException);
    }
  }

  public void prepareCarmerShutter()
  {
    try
    {
      AssetFileDescriptor localAssetFileDescriptor = this.mContext.getResources().openRawResourceFd(2131099648);
      if (this.mPlayer != null)
      {
        this.mPlayer.reset();
        this.mPlayer.setDataSource(localAssetFileDescriptor.getFileDescriptor(), localAssetFileDescriptor.getStartOffset(), localAssetFileDescriptor.getLength());
        this.mPlayer.setAudioStreamType(1);
        this.mPlayer.prepare();
      }
      return;
    }
    catch (Exception localException)
    {
      while (true)
        Log.d("SoundUtils", "Couldn't create click sound", localException);
    }
  }

  public void release()
  {
    this.mPlayer.release();
  }
}

/* Location:           E:\workspace\dex2java\dex-translator-0.0.9.3\HtcFootprints_dex2jar.jar
 * Qualified Name:     com.htc.android.footprints.utils.SoundPlayer
 * JD-Core Version:    0.6.0
 */